package cn.owng.server.common.generated.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 游戏服务器信息
 * </p>
 *
 * @author baomidou
 * @since 2024-08-11
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("game_service")
public class GameService extends Model<GameService> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "game_service_id", type = IdType.ASSIGN_ID)
    private Long gameServiceId;

    /**
     * 游戏 ID
     */
    @TableField("game_id")
    private Long gameId;

    /**
     * 服务器名称, 例如: 电信一区、电信二区
     */
    @TableField("name")
    private String name;

    /**
     * 公网连接地址
     */
    @TableField("address")
    private String address;

    /**
     * 内网地址
     */
    @TableField("internal_address")
    private String internalAddress;

    /**
     * 当前在线人数
     */
    @TableField("online")
    private Long online;

    /**
     * 允许最大玩家数量
     */
    @TableField("max_players")
    private Long maxPlayers;

    /**
     * 状态: 0=掉线, 1=在线
     */
    @TableField("status")
    private Integer status;

    /**
     * 是否维护状态: 0=否, 1=是
     */
    @TableField("maintenance")
    private Integer maintenance;

    /**
     * 排序
     */
    @TableField("sort_order")
    private Integer sortOrder;

    /**
     * 添加时间
     */
    @TableField("date_added")
    private Date dateAdded;

    /**
     * 更新时间
     */
    @TableField("date_modified")
    private Date dateModified;

    @Override
    public Serializable pkVal() {
        return this.gameServiceId;
    }
}
